home *** CD-ROM | disk | FTP | other *** search
- unit delBase;
-
- interface
- uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, ComOWL;
-
- type
- TDelOwlControl = class(TControl)
- private
- { Private declarations }
-
- FOnMessage : TMessageEvent;
- procedure FOnMessageExported(aMsg, wParam : Word; lParam: Longint);
- cdecl; export;
-
- protected
- { Protected declarations }
- OWLHelpControl : TCOMInterface;
- procedure VisibleChanging; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
-
- public
- { Public declarations }
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Invalidate; override;
- procedure Repaint; override;
- procedure Update; override;
- published
- { Published declarations }
-
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property Visible;
- end;
-
- implementation
-
- function _COMClassConstructor(parentHWnd : hWnd):
- TCOMInterface; cdecl; far; external 'OWLDEL'
- name '_COMCLASSCONSTRUCTOR';
-
- procedure _COMClassDestructor(mySlider : TCOMInterface); cdecl;
- far; external 'OWLDEL'
- name '_COMCLASSDESTRUCTOR';
-
-
-
- constructor TDelOwlControl.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
-
- if (Owner is TWinControl) then
- OWLHelpControl := _COMClassConstructor(TWinControl(Owner).Handle);
-
- if OWLHelpControl = nil then abort;
-
- if not (csDesigning in ComponentState) then
- OWLHelpControl.SetOnMessage(FOnMessageExported);
-
- Width := 120;
- Height := 40;
- {sync OWL and the VCL control}
- Visible := not Visible;
- Visible := not Visible;
- end;
-
- destructor TDelOwlControl.Destroy;
- begin
- _COMClassDestructor(OWLHelpControl);
- OWLHelpControl := nil;
- inherited Destroy;
- end;
- procedure TDelOwlControl.Invalidate;
- begin
- OWLHelpControl.Invalidate;
- end;
-
- procedure TDelOwlControl.Repaint;
- begin
- OWLHelpControl.Repaint;
- end;
-
- procedure TDelOwlControl.Update;
- begin
- OWLHelpControl.Update;
- end;
-
- procedure TDelOwlControl.FOnMessageExported(aMsg, wParam : Word; lParam: Longint);
- begin
- if (csDesigning in ComponentState) or
- (csLoading in ComponentState)then Exit;
- Perform(aMsg, wParam, lParam);
- end;
-
- procedure TDelOwlControl.VisibleChanging;
- begin
- OWLHelpControl.SetVisible(wordbool(not Visible));
- end;
-
- procedure TDelOwlControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
- begin
- inherited SetBounds(ALeft, ATop, AWidth, AHeight);
- OWLHelpControl.SetBounds(ALeft, ATop, AWidth, AHeight);
- end;
-
- end.
-